package com.itita.ww2.handler.requesthandler.basemap;

import java.sql.SQLException;

import com.smartfoxserver.v2.entities.User;
import com.smartfoxserver.v2.entities.data.ISFSObject;
import com.itita.ww2.core.WW2Exception;
import com.itita.ww2.utils.handler.IRequestOper;

/**
 * 移除地图单位
 * @author NorthLan
 *
 */
public class MapUnitRemove implements IRequestOper {

	@Override
	public boolean execute(String requestCMD, User user, ISFSObject params) throws WW2Exception, SQLException {
		//		int uid = UserService.getInstance().getUid(user);
		//		String mapCode = params.getUtfString("code");// 地图代号,如:"Map636052715960779660"
		//		// 
		//		ISFSObject backObj = new SFSObject();
		//		backObj.putInt(R.DATA_KEY_COUNTER, params.getInt(R.DATA_KEY_COUNTER));
		//		// 
		//
		//		// 用户地图数据
		//		ISFSObject userMapdata = UserService.getInstance().getUserMapdata(uid);
		//
		//		// 用户没有此单位
		//		if (!userMapdata.containsKey(mapCode)) {
		//			MessageHandler.getInstance().sendMsg(requestCMD, backObj, user, MsgCode.BASEMAP_USER_HAS_NO_UNIT, false);
		//			return false;
		//		}
		//
		//		// 移除
		//		UserService.getInstance().removeMapUnit(uid, mapCode);
		//
		//		// 移除时间计划,如果存在
		//		UserService.getInstance().removeDevTime(uid, DevTimeType.UPGRADE, mapCode);
		//
		//		// 回传
		//		MessageHandler.getInstance().sendMsg(requestCMD, backObj, user, null, true);
		return true;
	}

}
